import 'package:json_annotation/json_annotation.dart';

part 'login_resp.g.dart';

@JsonSerializable()
class LoginResp {
  final String? token;
  final User? user;

  const LoginResp({
    this.token,
    this.user,
  });

  factory LoginResp.fromJson(Map<String, dynamic> json) =>
      _$LoginRespFromJson(json);

  Map<String, dynamic> toJson() => _$LoginRespToJson(this);
}

@JsonSerializable()
class User {
  final String? userId;
  final String? name;
  final String? nickName;
  final List<int>? centerIds;

  const User({
    this.userId,
    this.name,
    this.nickName,
    this.centerIds,
  });

  factory User.fromJson(Map<String, dynamic> json) =>
      _$UserFromJson(json);

  Map<String, dynamic> toJson() => _$UserToJson(this);
}
